//package com.example.java.kafka.es9client;
//
//import co.elastic.clients.elasticsearch._types.ElasticsearchException;
//
//public class CreateIndex {
//    public static void main(String[] args) {
//        ConnectElasticsearch.connect(client -> {
//            try {
//                client.indices().create(req -> req.index("user"));
//                System.out.println("User index create successful");
//            }catch (Exception e) {
//                if (e instanceof ElasticsearchException) {
//                    System.out.println("User index is already exist");
//                }else {
//                    e.printStackTrace();
//                }
//            }
//        });
//    }
//}